
<?php
	include("connection_mysqli.php");	
	$req=$connexion->query('DELETE FROM order WHERE deliverytime < NOW() ');
	
	if (!$req) {
		die('Could not query' . mysql_error());
		echo("fail to delete orders");
	}
	$req->close();
	
	$req1=$connexion->query('UPDATE product SET promotion=\'non\',pricepromo=\'NULL\',enddatepromo=\'NULL\'  WHERE enddatepromo < NOW()  ');
	
	if (!$req1) {
		die('Could not query' . mysql_error());
		echo("fail to clean promo");
	}

	$req1->close();
	
	
	$connexion->close();
?>
